package android.team.app.utility;

import java.util.regex.Pattern;

import android.widget.EditText;

public class SmartStringUtility {
	/**
	 * Check Edit Text input string
	 * 
	 * @param editText
	 * @return
	 */
	public static boolean isEmpty(EditText editText) {
		if (editText == null
				|| editText.getEditableText() == null
				|| editText.getEditableText().toString().trim().equalsIgnoreCase("")) {
			return true;
		}
		return false;
	}
	
	 public static Pattern EMAIL_ADDRESS_PATTERN = Pattern.compile(
		        "[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"
		    );

    public static boolean checkEmail(String email) {
        return EMAIL_ADDRESS_PATTERN.matcher(email).matches();
    }
}
